import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import movie from '@/views/movie'
import record from '@/views/record'
import my from '@/views/my'
import home from '@/views/home'
import login from '@/views/login'
import city from '@/views/city'
import prodetail from '@/views/MovieDetail'
import search from '@/views/search'
import remark from '@/views/remark'
const searchList = () => import('@/views/search/list')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: home
      },
      {
        path: '/movie',
        component: movie
      },
      {
        path: '/record',
        component: record
      },
      {
        path: '/my',
        component: my
      }
    ]
  },
  {
    path: '/city',
    component: city
  }, // 城市
  {
    path: '/login',
    component: login
  }, // 登录
  { path: '/prodetail', component: prodetail }, // 电影细节
  { path: '/search', component: search }, // 搜索
  { path: '/searchList', component: searchList },
  { path: '/remark', component: remark }
]

const router = new VueRouter({
  routes
})

export default router
